namespace LocalBoard.Web.UserControls
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;

	/// <summary>
	///		Summary description for UserInfoLink.
	/// </summary>
	public partial class UserInfoLink : System.Web.UI.UserControl
	{
		private string _label = "";
		private string _labelCss = "";
		private string _userName = "";
		private string _userId = "";
		private string _link = "";
		private string _linkCss = "";
		private string _target = "";
		public string Label
		{
			get {return _label;}
			set {_label = value;}
		}
		public string LabelCss
		{
			get {return _labelCss;}
			set {_labelCss = value;}
		}
		public string UserName
		{
			get {return _userName;}
			set {_userName = value;}
		}
		public string UserId
		{
			get {return _userId;}
			set {_userId = value;}
		}
		public string Link
		{
			get {return _link;}
			set {_link = value;}
		}
		public string LinkCss
		{
			get {return _linkCss;}
			set {_linkCss = value;}
		}
		public string Target
		{
			get {return _target;}
			set {_target = value;}
		}

		protected void Page_Load(object sender, System.EventArgs e)
		{
			if(_label.Length > 0)
				managerLabel.Text = _label;
			if(_labelCss.Length > 0)
				managerLabel.CssClass = _labelCss;
			if(_link.Length > 0)
				clubManagerLink.NavigateUrl = _link;
			if(_linkCss.Length > 0)
				clubManagerLink.CssClass = _linkCss;
			if(_target.Length > 0)
				clubManagerLink.Target = _target;

			if(_userName.Length == 0 && _userId.Length == 0)
			{
				clubManagerLink.Text = "none";
				clubManagerLink.NavigateUrl = "";
			}
			else
			{
				clubManagerLink.Text = _userName;
				clubManagerLink.NavigateUrl = ClubPage.AddUserQueryStringToUrl(clubManagerLink.NavigateUrl, _userId);
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{

		}
		#endregion
	}
}
